<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>管理中心 - 添加栏目</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/css/system/general.css" rel="stylesheet" type="text/css" />
	<link href="${ctx}/css/system/main.css" rel="stylesheet" type="text/css" />
	<link href="${ctx}/css/system/category.css" rel="stylesheet" type="text/css" />	
	<script type="text/javascript" src="${ctx}/js/jquery-1.4.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/json.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/new-product-category.js"></script>
	<script language="JavaScript">
	 var contextPath = "${ctx}";
	 $(document).ready(findCategoryList);
	 
	</script>
      <style>
       <!--
        body{
      	   font-size:13px;
      	}
      	.product-img-div{
      	   margin-left:5px;
      	}
       -->
      </style> 
</head>
<body>
<h1>
<span class="action-span"></span>
<span class="action-span1"><a href="#">管理中心</a>  - 选择类目 </span>
<div style="clear:both"></div>
</h1>

<div class="main-div">
  <form:form action="${ctx}/member/product/continue_to_create" method="post" name="theForm" id="theForm" onsubmit="this.submit.disabled='true';">
  <input type="hidden" name="p_cate_id" id="p_cate_id" value="${categoryId}"/>
  <input type="hidden" name="is_leaf" id="is_leaf" value=""/>
  <table width="100%" id="general-table">
      <tr>
        <td class="label">产品类目</td>
        <td>
	       <div class="cascading-container">
		    <ol id="J_OlCascadingList">
		      
		      <li id="l_1" class="root">
		        <ul id="u_1">
		        <c:forEach items="${rootCategoryList}" var="varTemp">
		            <c:choose>
			           <c:when test="${varTemp.isLeaf==0}">
			             <c:choose>
			                <c:when test="${cateIdMap[varTemp.id]!=null}">
		               <li id="${varTemp.id}"  class="parent selected"><span>${varTemp.name}</span></li>
			                </c:when>
			                <c:otherwise>
		               <li id="${varTemp.id}" class="parent"><span>${varTemp.name}</span></li>
			                </c:otherwise>
			             </c:choose>
			           </c:when>
			           <c:otherwise>
			             <c:choose>
			                <c:when test="${cateIdMap[varTemp.id]!=null}">
		               <li id="${varTemp.id}"  class="selected"><span>${varTemp.name}</span></li>
			                </c:when>
			                <c:otherwise>
		               <li id="${varTemp.id}"><span>${varTemp.name}</span></li>
			                </c:otherwise>
			             </c:choose>
			           </c:otherwise>
			        </c:choose>
		        </c:forEach>
		        </ul>
		      </li>
		      
		      
		      <c:forEach items="${map}" var="entry" varStatus="entryStatus">
		         <li id="_o_l_${entryStatus.index+1}">
		           <ul id="_o_l_u_${entryStatus.index+1}">
		         <c:forEach items="${entry.value}" var="varTemp" varStatus="varStatusTemp">
		           <c:choose>
		             <c:when test="${varTemp.isLeaf==0}">
			           <c:choose>
			             <c:when test="${cateIdMap[varTemp.id]!=null}">
			          <li id="${varTemp.id}" class="parent selected"><span>${varTemp.name}${entry.key}</span></li>
			             </c:when>
			             <c:otherwise>
			          <li id="${varTemp.id}" class="parent"><span>${varTemp.name}</span></li>
			             </c:otherwise>
			           </c:choose>
		             </c:when>
		             <c:otherwise>
			           <c:choose>
			             <c:when test="${cateIdMap[varTemp.id]!=null}">
			          <li id="${varTemp.id}" class="selected"><span>${varTemp.name}</span></li>
			             </c:when>
			             <c:otherwise>
			          <li id="${varTemp.id}"><span>${varTemp.name}</span></li>
			             </c:otherwise>
			           </c:choose>
		             </c:otherwise>
		           </c:choose>
		         </c:forEach>
		           </ul>
		         </li>
		      </c:forEach>
		      
		    </ol>
		  </div>
        </td>
      </tr>
  </table>
      <div class="button-div">
        <c:choose>
           <c:when test="${categoryId!=null}">
        <input type="submit" id="nextOperation" value=" 下一步,填写详细信息 " />
           </c:when>
           <c:otherwise>
        <input type="submit" id="nextOperation" disabled="disabled" value=" 下一步,填写详细信息 " />
           </c:otherwise>
        </c:choose>
      </div>
  </form:form>
</div>
</body>
</html>